04. Install Webpack
Installing Webpack
And just like that, we’re ready to get down to business with Webpack. At the time this course is created, the most recent stable version of Webpack is version 4. Webpack 4 comes with some significant changes from previous versions, so you will find different information out there if you read an older tutorial.
One of the new things about version 4, is that webpack declared a few default settings that are automatically in place when you install webpack. So, you might not even need a webpack config file. Our app won’t be following all the default settings, so we will need a custom config file, but it’s just a cool thing that webpack changed.
So, first things first, we need to install webpack. It is an npm package, so we run our usual npm install command, and while we’re at it, we’ll install the CLI tool as well. A CLI tool is a pretty common thing you’ll see accompanying developer tools. Its a terminal program that allows you to run commands from the command line and you install it like a normal npm package, so we will install both of these at the same time:
npm i webpack webpack-cli
Remember that npm i is just shorthand for npm install.
You have been successful when you see webpack and webpack-cli added to your package.json dependencies.
FEND C04 L02 A03 Install Webpack
Quiz
SOLUTION:
Allows us to override the webpack default setup as necessaryInterview Question
QUESTION: Interview Question
At work, a project requires the use of a technology that is completely new to you. What steps would you take to learn the required technology?
ANSWER:
I came across these types of questions fairly often while interviewing. Companies want to understand your process, and they really want to know that you are confident and capable of picking up new languages quickly. Most importantly with questions like this, show that you have a process for learning and let your hard work learning code shine to highlight just how quickly you pick up these topics.